package Day09;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-09-20
 * Time: 10:20
 * To BE A Better Person-2020-3-2
 */
public class TestDemo {
    public static int addAB(int A, int B) {
        //两数异或的结果就是相加不进位的结果
        int sum=A^B;
        //计算什么在哪位进位了
        int carry=(A&B) << 1;
        return sum+carry;

    }
    public static void main(String[] args) {
        int ret=addAB(2,3);
        System.out.println(ret);

    }
}
